Skip to main content

mainStackChanged

Type

message

Summary

Sent to a stack when its mainStack is changed.

Syntax

mainStackChanged

Description

Handle the mainStackChanged message if you want to respond when a substack is moved to another stack file.

Each stack file consists of a main stack, and may also include one or more substacks. To move a stack to another file, you set its mainStack property to the name of the main stack of the destination file. The moved stack becomes a substack of the main stack you specified.

The mainStackChanged message is sent right after the stack is moved to the new stack file. This means that (if the substack does not trap the message) the mainStackChanged message is received by the new main stack, and can be handled in the main stack's script.

The mainStackChanged message is used by the LiveCode development environment, so if you handle this message, be sure to pass it at the end of the handler.

Examples

on mainStackChanged -- in a main stack's script
save me -- save the stack file when a substack is added
end mainStackChanged

glossary: substack, stack file, message, handler, handle, development environment

object: stack

property: mainStack

control structure: pass

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?